home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_aet_opencut.cog < prev    next >
Text File  |  1999-11-15  |  8KB  |  309 lines

  1. # Jones 3D Cog Script
  2. #
  3. # aet_OpenCut.cog
  4. #
  5. # [TL] & [PAZ] & [HB] & [RT]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. #
  9. # ==============================================================================
  10.  
  11. symbols
  12.  
  13. message        startup
  14. message        user0
  15. message        entered
  16.  
  17. thing        player                                    local
  18. thing        fadeplate                                nolink
  19.  
  20. # Doors that open/close when marduk enters/exits:
  21. thing        door1
  22. thing        door2
  23. thing        door3
  24.  
  25. # targets & marks:
  26. thing        soph
  27. thing        indy                                            # Indy actor
  28. thing        doortarg                                nolink
  29. thing        indytarg2                                        # Mark for Indy to be teleported to
  30. thing        cage                                            # Sophia's cage.
  31. thing        cagetarg                                        # Target for the cage to move to.
  32. thing        cagebouncetarg                            local    # create on fly
  33.  
  34. # camera positions:                                
  35. thing        cam0                                    nolink    # Camera in Mophia room.
  36. thing        cam1                                    nolink    # Camera in Marduk room.
  37.  
  38. # necessary evils:
  39. keyframe    in_falling=in_jump_fall.key                local     # Falling key for actor.
  40. keyframe    cg_spin=inf_cage.key                    local    # Animation for cage
  41.  
  42. sound        machine=at01j01.wav                        local    # "...this whole place is a machine..."
  43. sound        ahhh=INXJ015.wav                        local    # Indy yells...
  44. sound        nooo=im03s15.wav                        local    # Sophia
  45.  
  46. sound        musicA=mus_olv_snakedead.wav            local
  47. sound        musicB=mus_inf_awesome4.wav                local
  48.  
  49. sound        doorstart=aet_dais_start.wav            local
  50. sound        doormove=aet_dais_move.wav                local
  51. sound        doorstop=aet_dais_stop.wav                local
  52.  
  53. sound        cagestop=aet_moph_fireball.wav            local    
  54. sound        collidecage=aet_mr_hit_indy.wav            local    
  55.  
  56. sound        ascend=gen_cage_ascend.wav                local
  57. sound        descend=gen_cage_descend.wav               local
  58.  
  59. sector        musictrigger
  60. sector        doortrigger                                mask=400
  61. sector        camsector                                local    # var
  62.  
  63. template    tpl_ghost=ghost                            local
  64.  
  65. vector        v_down                                    local
  66. vector        v_camspot                                local
  67.  
  68. int            cursound                                local
  69. int            doorclose=0                                local    # flag
  70. int            done0=0                                    local    # bulletproofing
  71. int            mus_track                                local
  72. int            pl_colltype                                local
  73. int            dr_colltype                                local
  74.  
  75. int            bSeen=0                                    local
  76.  
  77. end
  78.  
  79. # ==============================================================================
  80.  
  81. code
  82.  
  83. startup:
  84.  
  85.     SetMasterCog(GetSelfCog()); # RT: Set master cog so we get autosave/restore message
  86.  
  87.     Sleep(0.001); # Let engine get set up
  88.  
  89.     # Start on black...
  90.     SetCameraLookInterp(2, 0);
  91.     SetCameraPosInterp(2, 0);
  92.     SetCameraSecondaryFocus(2, doortarg);
  93.     SetCameraFocus(2, cam0);        
  94.     SetCurrentCamera(2);
  95.     SetCameraFOV(35, 0, 0);
  96.  
  97.     return;
  98.  
  99. # ..............................................................................
  100.  
  101. user0: # RT: Indicates that autosave/restore has completed...
  102.  
  103.     if (bSeen) return; # RT
  104.     bSeen = 1;
  105.  
  106.     player = GetLocalPlayerThing();
  107.  
  108.     CopyPlayerHolsters(player, indy);
  109.  
  110.     # Cage stuff
  111.     AISetCutsceneMode(cage);
  112.     ClearThingFlags(cage, 0x80000);
  113.     SetThingMass(cage, 0);
  114.     SetCollideType(cage, 0);
  115.  
  116.     # Sophia stuff
  117.     ClearPhysicsFlags(soph, 0x01);                     # No gravity no more.
  118.     AttachThingToThingEx(soph, cage, 0x000C);         # Attach soph to cage.
  119.     SetThingMass(soph, 0);                            # Stop sophia from moving.
  120.     SetCollideType(soph, 0);
  121.  
  122.     # Spin cage...
  123.     PlayKey(cage, cg_spin, 4, 0x0, 0);
  124.     
  125.     # Cut to Mophia room cam and focus on cage...
  126.     SetCameraLookInterp(2, 0);
  127.     SetCameraPosInterp(2, 0);
  128.     SetCameraSecondaryFocus(2, doortarg);
  129.     SetCameraFocus(2, cam0);        
  130.     SetCurrentCamera(2);
  131.     SetCameraFOV(35, 0, 0);
  132.     
  133.     ClearThingFlags(fadeplate, 0x80000);
  134.     SetCollideType(fadeplate, 0);
  135.     SetThingAlpha(fadeplate, 1.0);
  136.     SetThingAlpha(indy, 0.0);
  137.     SetThingAlpha(soph, 0.0);
  138.     SetThingAlpha(cage, 0.0);
  139.  
  140.     Sleep(0.01);
  141.  
  142.     # Begin opening cutscene...
  143.     StartCutScene(2);
  144.     mus_track = PlaySoundLocal(musicA, 0, 0, 0x0, 0); # force load
  145.  
  146.     # Prepare actor, camera, and player...
  147.     pl_colltype = GetCollideType(player);
  148.     SetActorFlags(player, 0x200000);
  149.     SetThingFlags(player, 0x80000);
  150.     AISetCutsceneMode(indy);
  151.     
  152.     # Fade in...
  153.     ThingFadeAnim(fadeplate, 1.0, 0.0, 1.0, 0);
  154.     
  155.     # Open doors...
  156.     dr_colltype = GetCollideType(door1);
  157.     SetCollideType(door1, 0);
  158.     SetCollideType(door2, 0);
  159.     SetCollideType(door3, 0);
  160.     MoveToFrame(door1, 1, 2.0);
  161.     MoveToFrame(door2, 1, 2.0);
  162.     MoveToFrame(door3, 1, 2.0);
  163.  
  164.     PlaySoundLocal(doorstart, 1.0, 0, 0x0, 0);
  165.     //cursound = PlaySoundLocal(doorstart, 1.0, 0, 0x0, 0);
  166.     //WaitForSound(cursound);    
  167.     cursound = PlaySoundLocal(doormove, 1.0, 0, 0x1, 0);
  168.     WaitForStop(door1);
  169.     StopSound(cursound, 0.0);
  170.     PlaySoundLocal(doorstop, 1.0, 0, 0x0, 0);
  171.  
  172.     # Make a cage target...
  173.     v_camspot = VectorAdd(VectorTransformToOrient(cagetarg, '0.0 0.0 -0.1'), GetThingPos(cagetarg));    
  174.     camsector = FindNewSectorFromThing(cagetarg, v_camspot);
  175.     cagebouncetarg = CreateThingAtPos(tpl_ghost, camsector, v_camspot, '0 0 0');
  176.     CaptureThing(cagebouncetarg);
  177.     
  178.     PlaySoundLocal(ascend, 1.0, 0, 0x0, 0);
  179.     //PlaySoundThing(ascend, cage, 1.0, 5.0, 15.0, 0x0);
  180.  
  181.     # Move cage down
  182.     AISetMoveSpeed(cage, 2.0);
  183.     AISetMoveThing(cage, cagebouncetarg, 0);
  184.     ThingFadeAnim(soph, 0.0, 1.0, 0.5, 0);
  185.     ThingFadeAnim(cage, 0.0, 1.0, 0.5, 0);
  186.     SetCameraFOV(85, 1, 3.8); # was 4.0
  187.     Sleep(1.0);
  188.                 
  189.     # Tilt down to watch...
  190.     SetCameraLookInterp(2, 1);
  191.     SetCameraInterpSpeed(2, 2.8); # was 3.0
  192.     Sleep(0.01);
  193.     SetCameraSecondaryFocus(2, cagetarg);
  194.     Sleep(1.0);    
  195.  
  196.     PlayVoice(soph, nooo, 1.0, 0);
  197.     Sleep(0.5);
  198.  
  199.     AIWaitForStop(cage);
  200.     Sleep(0.01);
  201.     PlaySoundLocal(cagestop, 1, 0, 0x0, 0);
  202.     AISetMoveSpeed(cage, 1.0);
  203.     AISetMoveThing(cage, cagetarg, 1);
  204.     Sleep(2.0);
  205.     
  206.     # Tilt back up...
  207.     SetCameraInterpSpeed(2, 0.7);
  208.     Sleep(0.01);
  209.     SetCameraSecondaryFocus(2, doortarg);
  210.     SetCameraFOV(50, 1, 0.7);
  211.     Sleep(0.8);
  212.     
  213.     //StopSound(mus_track, 0.0);
  214.     PlaySoundLocal(musicA, 1, 0, 0x0, 0);
  215.     
  216.     # Reveal indy, make him flail
  217.     SetThingAirDrag(indy, 3.0);
  218.     ClearThingFlags(indy, 0x80000);
  219.     PlayKey(indy, in_falling, 2, 0x0, 0);
  220.     ThingFadeAnim(indy, 0.0, 1.0, 0.3, 0);
  221.     Sleep(1.0);
  222.  
  223.     # Tilt down again...
  224.     SetCameraSecondaryFocus(2, cagetarg);
  225.     SetCameraInterpSpeed(2, 1.6); # was 2.0    
  226.     SetCameraFOV(80, 1, 1.6); # was 2.0
  227.  
  228.     PlayVoice(player, ahhh, 1.0, 0);
  229.     
  230.     # Sleep 'til Indy gets to cage...
  231.       Sleep(1.8);
  232.     
  233.     # Teleport indy to below the cage
  234.     PlaySoundLocal(collidecage, 1, 0, 0x0, 0);
  235.     TeleportThing(indy, indytarg2);
  236.  
  237.     # Cut to cam1 down below...
  238.     SetThingAirDrag(indy, 2.5);
  239.     SetCameraLookInterp(2, 0);
  240.     SetCameraFocus(2, cam1);
  241.     SetCameraSecondaryFocus(2, indy);
  242.     Sleep(0.01);
  243.     SetCameraFOV(90, 1, 1.0);
  244.  
  245.     # Sleep long enough for indy to fall to camera
  246.     Sleep(1.6); # was 1.2
  247.       
  248.     # Move the player to the actor's position    
  249.     TeleportThing(player, indy);
  250.     
  251.     # Camera follows him as he swings past...
  252.     ResetCameraFOV(0, 0.0);
  253.     SetCameraPosition(1, GetThingPos(cam1));  
  254.     SetCurrentCamera(1);
  255.     
  256.     # Give the player control as he falls into the aetherium
  257.     SetThingFlags(indy, 0x80000);
  258.     ClearThingFlags(player, 0x80000);
  259.     SetCollideType(player, 0);
  260.     v_down = GetThingVel(indy);
  261.     SetThingVel(player, v_down);
  262.     SetThingAirDrag(player, 0.68);
  263.  
  264.     Sleep(1.0);
  265.     
  266.     PlaySoundLocal(descend, 1, 0, 0x0, 0);
  267.     
  268.     Sleep(1.5);
  269.     # Close doors...
  270.     doorclose = 1;
  271.     MoveToFrame(door1, 0, 2.0);    
  272.     MoveToFrame(door2, 0, 2.0);    
  273.     MoveToFrame(door3, 0, 2.0);
  274.     cursound = PlaySoundThing(doorstart, door1, 0.5, 5.0, 10.0, 0x484);
  275.     WaitForSound(cursound);
  276.     cursound = PlaySoundThing(doormove, door1, 0.5, 5.0, 10.0, 0x485);
  277.     WaitForStop(door1);
  278.     StopSound(cursound, 0.0);
  279.     cursound = PlaySoundThing(doorstop, door1, 1.0, 5.0, 10.0, 0x484);
  280.     SetCollideType(door1, dr_colltype);
  281.     SetCollideType(door2, dr_colltype);
  282.     SetCollideType(door3, dr_colltype);
  283.     WaitForSound(cursound);
  284.  
  285.     DestroyThing(cagebouncetarg);
  286.     SetCollideType(player, pl_colltype);
  287.     SetThingAirDrag(player, 0.5); # standard
  288.     PlayVoice(player, machine, 1.0, 1);
  289.         
  290.     EndCutScene();
  291.     ClearActorFlags(player, 0x200000);
  292.  
  293.     return;
  294.  
  295. # ..............................................................................
  296.  
  297. entered:
  298.  
  299. if ((GetSenderRef() == musictrigger) && (bSeen == 1) && (done0 == 0))
  300.     {
  301.         done0 = 1;
  302.         PlaySoundLocal(musicB, 1, 0, 0x0, 0);
  303.     }
  304.     
  305.     return;
  306.  
  307. end
  308.  
  309.